Xbasic

Array get_dynamic Method

Syntax

dim Result as L = <array>.get_dynamic()

Returns

ResultLogical

If .t., dynamic sizing is on, otherwise .f..

Description

Indicates whether the dynamic sizing property of an array is on or off.

Discussion

The <array>.get_dynamic() method can be used to determine the state of an array's dynamic sizing property.

If you DIM an array with a size of 0 and then populate the array using the [] syntax, the dynamic sizing property is automatically turned on. Otherwise, the dynamic sizing property is turned off.

Example

This shows that an array DIMmed with an initial size of 0 defaults to dynamic properties on, whereas an array DIMmed with non-zero size defaults to dynamic properties off.

dim arr1[0] as p
dim arr2[1] as p
? arr1.get_dynamic()
= .T.

? arr2.get_dynamic()
= .F.

See Also